package com.hmall.order.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hmall.order.mapper.OrderDetailMapper;
import com.hmall.order.pojo.OrderDetail;
import com.hmall.order.service.OrderDetailService;
import org.springframework.stereotype.Service;

/*
 *   Description OrderDetailServiceImpl
 *   @author zhangyan
 *   @time   2024/11/15
 */
@Service
public class OrderDetailServiceImpl extends ServiceImpl<OrderDetailMapper, OrderDetail> implements OrderDetailService {

    /**
     * 根据订单id查询订单详情
     *
     * @param id
     * @return
     */
    @Override
    public OrderDetail findByOrderId(Long id) {
        OrderDetail orderDetail = this.lambdaQuery()
                .eq(OrderDetail::getOrderId, id)
                .one();
        return orderDetail;
    }
}
